package com.samuel.webflux;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.web.reactive.function.server.RequestPredicates.POST;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;

/**
 * @date:2017/11/27
 * @time: 19:35
 * @author:zhaoyang
 * @desc:
 **/

@Configuration
public class RouterConfiguration {

    @Bean
    public RouterFunction<ServerResponse> saveUser(UserHandler userHandler){

        return route(POST("/web/flux/user/save"),userHandler::save);
    }
}
